/*
 * Copyright (C) 2011, EADS France
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
package xowl.interpreter.backends.pellet;

/**
 *
 * @author Laurent WOUTERS
 */
public class JenaReasoner implements xowl.interpreter.backends.jena.ReasonerProvider {
    public static final boolean disableLogging = true;
    
    private static final String config = "java.util.logging.ConsoleHandler.level = OFF";
    
    public JenaReasoner() {
        org.mindswap.pellet.PelletOptions.USE_CLASSIFICATION_MONITOR = org.mindswap.pellet.PelletOptions.MonitorType.NONE;
        org.mindswap.pellet.PelletOptions.PROCESS_JENA_UPDATES_INCREMENTALLY = false;
        if (disableLogging) {
            try {
                java.util.logging.LogManager manager = java.util.logging.LogManager.getLogManager();
                manager.readConfiguration(new java.io.ByteArrayInputStream(config.getBytes("UTF-8")));
            } catch (java.io.IOException ex) {}
        }
    }
    
    @Override public com.hp.hpl.jena.reasoner.Reasoner createReasoner() {
        return org.mindswap.pellet.jena.PelletReasonerFactory.theInstance().create();
    }
}
